import argparse
import sys
from tx_hospitalgptxlnet import hosipital_gpt

def args_from_cmdline():
    parser = argparse.ArgumentParser()
    parser.add_argument('--text', type=str, default=None)
    parser.add_argument('-p', '--model_path', type=str, default='weights/bilstm_model_xlnet_new.pth')
    args = parser.parse_args()
    return args

if __name__ == "__main__":
    args=args_from_cmdline()

    if args.text == None:
        print('请输入症状描述。')
    else:
        medical_result_dialog, reply, medical_result, department_out, flag_call_120 =hosipital_gpt(args.text, args.model_path)

        print(medical_result_dialog)
        print(reply)

        sys.exit()


        '''if flag_call_120:
            print('您可以拨打120进行急救，有更多症状请继续描述。')'''
